import {createRouter,createWebHashHistory} from 'vue-router'

const routes = [
  {
    path:'/',
    redirect:'home',
    component: () => import('../views/Main.vue'),
    children:[
      {
        path:'home',
        name:'Home',
        component: () => import('../views/Home.vue'),
      },
      {
        path:'user',
        name:'User',
        component: () => import('../views/User.vue'),
        meta:[{title:'系统管理'},{title:'用户管理',url:'/user'}]
      },
      {
        path:'tag',
        name:'Tag',
        component: () => import('../views/Tag.vue'),
        meta:[{title:'系统管理'},{title:'标签管理',url:'/tag'}]
      },
      {
        path:'article',
        name:'Article',
        component: () => import('../views/Article.vue'),
        meta:[{title:'内容管理'},{title:'文章管理',url:'/article'}]
      },
      {
        path:'column',
        name:'Column',
        component: () => import('../views/Column.vue'),
        meta:[{title:'内容管理'},{title:'专栏管理',url:'/column'}]
      },
      {
        path:'article/comment',
        name:'ArticleComment',
        component: () => import('../views/ArticleComment.vue'),
        meta:[{title:'评论管理'},{title:'文章评论',url:'/article/comment'}]
      },
      {
        path:'post/comment',
        name:'PostComment',
        component: () => import('../views/PostComment.vue'),
        meta:[{title:'评论管理'},{title:'帖子评论',url:'/post/comment'}]
      }
    ]
  },
  {
    path:'/login',
    name:'Login',
    component: () => import('../views/Login.vue')
  }
]

const router = createRouter({
  history:createWebHashHistory(),
  routes
})

export default router
